import os

# Process all images in a directory
for filename in os.listdir("images"):
    if filename.endswith(".jpg"):
        img = Image.open(f"images/{filename}")
        img.thumbnail((200, 200))
        img.save(f"thumbnails/{filename}")